package demo.practice.leetcode_msjd;


  class ListNode {
     int val;
     ListNode next;
     ListNode(int x) { val = x; }
 }

public class Msjd0201 {

    public ListNode removeDuplicateNodes(ListNode head) {
        if(head==null)
            return head;
        int [] arr= new int[20001];

        ListNode node=head;
        while (node.next!=null){
            arr[node.val]=1;
            if(arr[node.next.val]==1){
                node.next=node.next.next;
                //移动一位
            }else{
                node=node.next;
            }
        }

        return head;
    }

}
